package _02_第二季.排序;

import java.util.PriorityQueue;

public class PriorityQueueMain {
    public static void main(String[] args) {
        Integer[] nums = {5,2,6,3,8,7,89,50,42};
        PriorityQueue<Integer> minHeap = new PriorityQueue<>(nums.length);
        for(Integer num : nums){
            minHeap.offer(num);
        }
        for (Integer integer : minHeap) {
            System.out.print(integer+" ");
        }
        System.out.println();
        minHeap.remove(2);
        for (Integer integer : minHeap) {
            System.out.print(integer+" ");
        }
    }
}
